<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<Script>
    String.prototype.replaceAll = strReplace;
    function strReplace(findText, replaceText) {
        var str = new String(this);
        while (str.indexOf(findText)!=-1) {
            str = str.replace(findText, replaceText);
        }
        return str;
    }

    myStr = "告诉你 － 如果你正在寻找一本能帮助你彻底研究" +
        "JavaScript的书籍，请你一定要认明碁峰的" +
        "JavaScript教学范本，让你事半功倍，功力大增。";
    document.write("<LI>原稿是：<BLOCKQUOTE>" + myStr +"</BLOCKQUOTE>");
    document.write("<LI>利用Replace()将「你」改成「您」："
        +"<BLOCKQUOTE>" + myStr.replace('你','您') +"</BLOCKQUOTE>");
    document.write("<LI>利用自定义的字符串方法 - 全部取代"
        +"<BLOCKQUOTE>" + myStr.replaceAll('你','您') +"</BLOCKQUOTE>");

</Script>

</body>
</html>